#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char const *argv[])
{
    int m, n, sort[512], target[32][32], time[32][32], temp[32][32];
        
    cin >> m >> n;
    for (size_t i = 0; i < m * n; i++)
    {
        cin >> sort[i];
    }
    
    

    return 0;
}
